The programming language LISP: Its operation and applications: E. C. Berkeley and D. G. Bobrow (editors). The M.I.T. Press, 1966. $5.00

نویسنده

  • L. Monrad-Krohn
چکیده

Your s t y l e i s deve loped by a s e r i e s o f c h o i c e s . Which do you write, "O" o r "NIL"? They compi le i n t o i d e n t i c a l d a t a s t r u c t u r e s ; s o choos ing one o v e r t h e o t h e r i s a m a t t e r o f s t y l e . Do you p u t commas i n your l i s t s , o r do you s e p a r a t e t h e items w i t h s p a c e s ? The l i s t s w i l l l ook t h e same i n s i d e t h e machine whether you p u t t h e commas i n o r l e a v e them o u t ; s o i t ' s n o t a m a t t e r of e f f i c i e n c y , i t ' s a m a t t e r o f s t y l e . I f you had t o write t h e v a l u e o f cons[(^ B) ; (C D)]", which way would you write i t : And which o f t h e s e e x p r e s s i o n s would you write: A l 1 o f t h e s e c h o i c e s c o n t r i b u t e t o your s t y l e . Cho ice o f t h e Program F e a t u r e o r F u n c t i o n a l s To h e l p i n t h e d e v e l o p i n g o f a good s t y l e , 1 am g o i n g t o d i s c u s s two o f t h e more complex c h o i c e s you can make i n LISP. ( 1 ) Shou ld you use t h e program f e a t u r e ? ( 2 ) Should you u s e f u n c t i o n a l s ? I ' m n o t s a y i n g you s h o u l d a lways use t h e program f e a t u r e , and I ' m n o t s a y i n g you s h o u l d never u s e i t . But i t i s d e s i r a b l e t o make t h e c h o i c e c o n s c i o u s l y i n each case , w i t h o u t f e e l i n g t h a t i t must b e w r i t t e n one way o r t h e o t h e r . 1 happen t o f a v o r u s i n g t h e program f e a t u r e and n o t u s i n g f u n c t i o n a l s , b u t t h e c h o i c e s a r e up t o you. The program f e a t u r e i s n o t g i v e n much a t t e n t i o n i n t h e manua l ; t h e f i r s t ment ion o f i t i s on page 29. But any f u n c t i o n t h a t can b e w r i t t e n w i t h o u t t h e program f e a t u r e i s a f u n c t i o n t h a t can be w r i t t e n w i t h t h e program f e a t u r e . A t r i v i a l way i s t o t a k e a f u n c t i o n d e f i n e d a s "X[[x]; ---1" and r e w r i t e i t a s " ~ [ [ x ] ; p rog[ [ ] ; r e t u r n [ I l ] " . The r e s u l t i n g f u n c t i o n w i l l be equ iva l e n t t o t h e o r i g i n a l . The r e v e r s e i s a l s o t r u e any f u n c t i o n w r i t t e n w i t h t h e program f e a t u r e can be w r i t t e n w i t h o u t . 1 w i l l g i v e below some examples o f f u n c t i o n s w r i t t e n w i t h and w i t h o u t t h e program f e a t u r e , and then some examples o f funct i o n s w r i t t e n w i t h and w i t h o u t f u n c t i o n a l s . The f i n a l examples i l l u s t r a t e changes i n bo th a s p e c t s o f s t y l e a t t h e same t i m e . I n t h e append ix , 1 have i n c l u d e d S e x p r e s s i o n t r a n s l a t i o n s o f t h e f i r s t 5 examples . You may u s e t h e program f e a t u r e o r you may n o t u s e i t ; you may u s e f u n c t i o n a l s o r you may n o t u s e them. The examples below a r e t o h e l p you choose your s t y l e .

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A CONVERT compiler of REC for PDP-8

REC/8 is a CONVERT program, realized in the CTSS LISP of Project MAC, forcompiling REC expressions into the machine language of the PDP-8 computer. Since thecompilation consists in its majority of subroutine calls (to be compiled, after removal ofLISP parentheses by MACRO-8) the technique is applicable with trivial modification toany other computer having the subroutine jump and...

متن کامل

Balancing the EULISP Metaobject Protocol

The challenge for the metaobject protocol designer is to balance the connicting demands of eeciency, simplicity, and extensibility. It is impossible to know all desired extensions in advance; some of them will require greater functionality, while others require greater eeciency. In addition, the protocol itself must be suuciently simple that it can be fully documented and understood by those wh...

متن کامل

Common Lisp Object System Specification: 2. Functions in the Programmer Interface

The distribution and publication of this document are not restricted. In order to preserve the integrity of the specification, any publication or distribution must reproduce this document in its entirety, preserve its formatting, and include this title page. " The X3J13 Committee hereby accepts chapters 1 and 2 of the Common Lisp Object System, as defined in document 88-002R, for inclusion in t...

متن کامل

Object-Oriented Programming: Themes and Variations

Over the past few years object-oriented programming languages have become popular in the artificial intelligence community, often as add-ons to Lisp. This is an introduction to the concepts of object-oriented programming based on our experience of them in Loops, and secondarily a survey of some of the important variations and open issues that are being explored and debated among users of differ...

متن کامل

A Short Overview of AspectL

AspectL adds a number of features to the Common Lisp Object System (CLOS) that have been developed in the recent years in the AOSD community. According to the Lisp spirit, some of them have been generalized in the process of translating them to Common Lisp. These generalizations are likely to be interesting for designers of other aspectoriented programming languages as well since the bulk of As...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Automatica

دوره 4  شماره 

صفحات  -

تاریخ انتشار 1967